package com.sdjzu.wanfuying.androiddesign;

import android.os.Bundle;
import android.widget.Button;

import com.sdjzu.wanfuying.androiddesign.base.BaseActivity;
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog;

import java.util.Calendar;

import butterknife.BindView;
import butterknife.OnClick;

public class DateTimePickerActivity extends BaseActivity implements DatePickerDialog.OnDateSetListener {
    @BindView(R.id.activity_date_time_picker_btn_start)
    Button mBtnStart;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_date_time_picker);
    }

    @OnClick(R.id.activity_date_time_picker_btn_start)
    void showPicker(Button button) {
        Calendar now = Calendar.getInstance();
        DatePickerDialog dpd = DatePickerDialog.newInstance(
                DateTimePickerActivity.this,
                now.get(Calendar.YEAR), // Initial year selection
                now.get(Calendar.MONTH), // Initial month selection
                now.get(Calendar.DAY_OF_MONTH) // Inital day selection
        );
        // If you're calling this from a support Fragment
        // dpd.show(getFragmentManager(), "Datepickerdialog");
        // If you're calling this from an AppCompatActivity
        dpd.show(getSupportFragmentManager(), "Datepickerdialog");
    }

    @Override
    public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {

    }
}
